<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    body {
      transform-style: preserve-3d;
      perspective: 400px;
    }
    div {
      width: 200px;
      height: 200px;
      margin: 0 auto;
      background: #000;
      font-size: 36px;
      color: #fff;
      transition: all 5s;
      backface-visibility: hidden;
    }
  
    div:hover {
      transform: rotateY(180deg);
    }
  </style>
</head>
<body>
  <div>文字</div>
</body>
</html>